package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StoreRawMaterialCategoryMapper;
import com.ruoyi.system.domain.StoreRawMaterialCategory;
import com.ruoyi.system.service.IStoreRawMaterialCategoryService;

/**
 * 门店原料分类管理信息Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-27
 */
@Service
public class StoreRawMaterialCategoryServiceImpl implements IStoreRawMaterialCategoryService
{
    @Autowired
    private StoreRawMaterialCategoryMapper storeRawMaterialCategoryMapper;

    /**
     * 通过id查询门店原料分类管理分类信息
     *
     * @param id 门店原料分类管理信息主键
     * @return 门店原料分类管理分类信息
     */
    @Override
    public StoreRawMaterialCategory selectStoreRawMaterialCategoryById(Long id)
    {
        return storeRawMaterialCategoryMapper.selectStoreRawMaterialCategoryById(id);
    }

    /**
     * 通过分类名称查询门店原料分类管理信息列表
     *
     * @param categoryName 分类名称
     * @return 门店原料分类管理分类信息
     */
    @Override
    public List<StoreRawMaterialCategory> selectStoreRawMaterialCategoryListByName(String categoryName)
    {
        return storeRawMaterialCategoryMapper.selectStoreRawMaterialCategoryListByName(categoryName);
    }

    /**
     * 新增门店原料分类管理分类信息
     *
     * @param storeRawMaterialCategory 门店原料分类管理分类信息
     * @return 结果
     */
    @Override
    public int insertStoreRawMaterialCategory(StoreRawMaterialCategory storeRawMaterialCategory)
    {
        return storeRawMaterialCategoryMapper.insertStoreRawMaterialCategory(storeRawMaterialCategory);
    }

    /**
     * 修改门店原料分类管理分类信息
     *
     * @param storeRawMaterialCategory 门店原料分类管理分类信息
     * @return 结果
     */
    @Override
    public int updateStoreRawMaterialCategory(StoreRawMaterialCategory storeRawMaterialCategory)
    {
        return storeRawMaterialCategoryMapper.updateStoreRawMaterialCategory(storeRawMaterialCategory);
    }

    /**
     * 通过id批量删除门店原料分类管理信息
     *
     * @param ids 需要删除的门店原料分类管理类信息主键
     * @return 结果
     */
    @Override
    public int deleteStoreRawMaterialCategoryByIds(Long[] ids)
    {
        return storeRawMaterialCategoryMapper.deleteStoreRawMaterialCategoryByIds(ids);
    }

    /**
     * 通过id删除门店原料分类管理信息
     *
     * @param id 门店原料分类管理，信息主键
     * @return 结果
     */
    @Override
    public int deleteStoreRawMaterialCategoryById(Long id)
    {
        return storeRawMaterialCategoryMapper.deleteStoreRawMaterialCategoryById(id);
    }
}
